package xin.pan.strategy;

public class Configuration {

    protected ReaderConfiguration readerConfiguration;
    protected WriterConfiguration writerConfiguration;

    String setting(){
        return "common settings";
    }

    public Configuration(ReaderConfiguration readerConfiguration){
        this.readerConfiguration = readerConfiguration;
    }

    public Configuration(WriterConfiguration writerConfiguration){
        this.writerConfiguration = writerConfiguration;
    }

    public Configuration(ReaderConfiguration reader, WriterConfiguration writer){
        this.readerConfiguration = reader;
        this.writerConfiguration = writer;
    }

    public void setReaderConfiguration(ReaderConfiguration readerConfiguration){
        this.readerConfiguration = readerConfiguration;
    }

    public void setWriterConfiguration(WriterConfiguration writerConfiguration){
        this.writerConfiguration = writerConfiguration;
    }

    public String getConfig(){
        return this.readerConfiguration.readerConfig() + "\n" +
                this.writerConfiguration.writerConfig() + "\n" +
                this.setting();
    }

}
